﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MainSite.Master" AutoEventWireup="true" CodeBehind="UserManagementOld.aspx.cs" Inherits="BSCMFF.Web.Pages.UserManagement" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%--<%@ Page Title="" Language="C#" MasterPageFile="~/MainSite.Master" AutoEventWireup="true" CodeBehind="UserList.aspx.cs" Inherits="BSCMFF.Web.Pages.UserList1" %>--%>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    
    

    <asp:ImageButton ID="ImageButtonAddOneUser" runat="server" ImageUrl="~/Images/addOneUser.png" AlternateText="Create Employee" />
    <asp:ImageButton ID="ImageButtonImportUsers" runat="server" PostBackUrl="~/Pages/Administration/UserImport.aspx"
        ImageUrl="~/Images/import.png" AlternateText="Import Employees" 
        />
    
    

    <br />

   <%-- <asp:CollapsiblePanelExtender ID="CollapsiblePanelExtender1" runat="server">
    </asp:CollapsiblePanelExtender>--%>

    
    <br />
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Default">
    </telerik:RadAjaxLoadingPanel>
<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" Height="200px" Width="300px" LoadingPanelID="RadAjaxLoadingPanel1">
    
    <telerik:RadGrid ID="RadGrid1" runat="server" 
        AutoGenerateDeleteColumn="True" AutoGenerateEditColumn="True" 
        DataSourceID="EntityDataSourceUsers" GridLines="None" 
        
        oninsertcommand="RadGrid1_InsertCommand" 
        onupdatecommand="RadGrid1_UpdateCommand" 
        ondeletecommand="RadGrid1_DeleteCommand" 
         onitemcommand="RadGrid1_ItemCommand" CellSpacing="0" 
        AllowAutomaticDeletes="True" AllowAutomaticInserts="True" 
        AllowAutomaticUpdates="True" AutoGenerateColumns="False" 
        >
         <%--onselectedindexchanged="RadGrid1_SelectedIndexChanged1"--%>

        <MasterTableView DataKeyNames="ID" EditMode="PopUp" 
              CommandItemDisplay="Bottom"
            DataSourceID="EntityDataSourceUsers">
            <CommandItemSettings ExportToPdfText="Export to PDF" />
            <RowIndicatorColumn>
                <HeaderStyle Width="20px" />
            </RowIndicatorColumn>
            <ExpandCollapseColumn>
                <HeaderStyle Width="20px" />
            </ExpandCollapseColumn>
            <Columns>
                    <telerik:GridBoundColumn DataField="ID" 
                        FilterControlAltText="Filter ID column" HeaderText="ID" 
                        SortExpression="ID" UniqueName="ID" DataType="System.Int32" 
                        ReadOnly="True">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Firstname" 
                        FilterControlAltText="Filter Firstname column" HeaderText="Firstname" 
                        SortExpression="Firstname" UniqueName="Firstname">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Lastname" 
                        FilterControlAltText="Filter Lastname column" HeaderText="Lastname" 
                        SortExpression="Lastname" UniqueName="Lastname">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Email" 
                        FilterControlAltText="Filter Email column" HeaderText="Email" 
                        SortExpression="Email" UniqueName="Email">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Role_FK" 
                        FilterControlAltText="Filter Role_FK column" HeaderText="Role_FK" 
                        SortExpression="Role_FK" UniqueName="Role_FK" DataType="System.Int32">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Login" 
                        FilterControlAltText="Filter Login column" HeaderText="Login" 
                        SortExpression="Login" UniqueName="Login">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Password" 
                        FilterControlAltText="Filter Password column" HeaderText="Password" 
                        SortExpression="Password" UniqueName="Password">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="EmployeeID" 
                        FilterControlAltText="Filter EmployeeID column" HeaderText="EmployeeID" 
                        SortExpression="EmployeeID" UniqueName="EmployeeID">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="SBU_FK" DataType="System.Int32" 
                        FilterControlAltText="Filter SBU_FK column" HeaderText="SBU_FK" 
                        SortExpression="SBU_FK" UniqueName="SBU_FK">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Job_Position" 
                        FilterControlAltText="Filter Job_Position column" HeaderText="Job_Position" 
                        SortExpression="Job_Position" UniqueName="Job_Position">
                    </telerik:GridBoundColumn>
                  
                </Columns>
                <EditFormSettings EditFormType="WebUserControl" UserControlName="~/UserControls/Details/UserDetails.ascx" 
                PopUpSettings-Modal="true" PopUpSettings-Width="500px" PopUpSettings-CloseButtonToolTip="false" >
                    <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                    </EditColumn>
                    <PopUpSettings Modal="True" />
                </EditFormSettings>
                
               
        </MasterTableView>
         <FilterMenu EnableImageSprites="False">
         </FilterMenu>
        <HeaderContextMenu EnableAutoScroll="True">
        </HeaderContextMenu>
    </telerik:RadGrid>
</telerik:RadAjaxPanel>


    <asp:EntityDataSource ID="EntityDataSourceUsers" runat="server" 
        ConnectionString="name=BSCEntities" DefaultContainerName="BSCEntities" 
        EnableDelete="True" EnableFlattening="False" EnableInsert="True" 
        EnableUpdate="True" EntitySetName="Users"> 
    </asp:EntityDataSource>
    <asp:EntityDataSource ID="EntityDataSourceRoles" runat="server" 
        ConnectionString="name=BSCEntities" DefaultContainerName="BSCEntities" 
        EnableFlattening="False" EntitySetName="Roles">
    </asp:EntityDataSource>
    <asp:EntityDataSource ID="EntityDataSourceDepartments" runat="server" 
        ConnectionString="name=BSCEntities" DefaultContainerName="BSCEntities" 
        EnableFlattening="False" EntitySetName="SBUs" Select="it.[SBU_ID], it.[Name]">
    </asp:EntityDataSource>
</asp:Content>
